package cn.lili.controller.feign;

import cn.lili.modules.promotion.client.KanjiaActivityClient;
import cn.lili.modules.promotion.entity.dos.KanjiaActivity;
import cn.lili.modules.promotion.entity.dto.search.KanjiaActivitySearchParams;
import cn.lili.modules.promotion.service.KanjiaActivityService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: ftyy
 * @date: 2022-01-13 18:51
 * @description: 砍价活动参与记录Feign
 */
@RestController
@RequiredArgsConstructor
public class KanjiaActivityFeignController implements KanjiaActivityClient {

    private final KanjiaActivityService kanjiaActivityService;

    /**
     * 结束砍价活动
     *
     * @param kanjiaId 砍价活动id
     * @return 是否更新成功
     */
    @Override
    public boolean endKanjiaActivity(String kanjiaId) {
        return kanjiaActivityService.endKanjiaActivity(kanjiaId);
    }

    @Override
    public KanjiaActivity getById(String promotionId) {
        return kanjiaActivityService.getById(promotionId);
    }

    @Override
    public KanjiaActivity getKanjiaActivity(KanjiaActivitySearchParams kanJiaActivitySearchParams) {
        return kanjiaActivityService.getKanjiaActivity(kanJiaActivitySearchParams);
    }
}
